<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <base href="/">
  <meta charset="utf-8">
  <title>用户中心</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" href="res/layui/css/layui.css">
  <link rel="stylesheet" href="res/css/global.css">
  <link rel="stylesheet" href="css/sss.css">
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img th:src="${index[0].blogLogo}" alt="layui" width="200" height="40">
    </a>
    <ul class="layui-nav fly-nav-user">
      <!-- 登入后的状态 -->
      <div th:if="${user!=null}">
        <li class="layui-nav-item">
          <a class="fly-nav-avatar" href="javascript:;">
            <cite class="layui-hide-xs"><b th:text="${user.getUsername()}"></b></cite>
            <i class="iconfont icon-renzheng layui-hide-xs" title="认证信息：layui 作者"></i>
            <i class="layui-badge fly-badge-vip layui-hide-xs">VIP3</i>
            <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg">
          </a>
          <dl class="layui-nav-child">
            <dd><a href="user/userInfo"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
            <dd><a href="/"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
            <hr style="margin: 5px 0;">
            <dd><a href="#" id="logut" style="text-align: center;" >退出</a></dd>
          </dl>
        </li>
      </div>
    </ul>
  </div>
</div>

<div class="layui-container fly-marginTop fly-user-main">
  <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
    <li class="layui-nav-item">
      <a href="/">
        <i class="layui-icon">&#xe609;</i>
        我的主页
      </a>
    </li>
    <li class="layui-nav-item layui-this">
      <a href="user/userindex">
        <i class="layui-icon">&#xe612;</i>
        用户中心
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="user/userInfo">
        <i class="layui-icon">&#xe620;</i>
        基本设置
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="user/listUserBlog">
        <i class="layui-icon">&#xe60a;</i>
        文章管理
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="user/store">
        <i class="layui-icon">&#xe735;</i>
        VIP管理
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="user/order">
        <i class="layui-icon">&#xe63c;</i>
        订单管理
      </a>
    </li>
  </ul>

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>


  <div class="fly-panel fly-panel-user" pad20>
    <!--
    <div class="fly-msg" style="margin-top: 15px;">
      您的邮箱尚未验证，这比较影响您的帐号安全，<a href="activate.html">立即去激活？</a>
    </div>
    -->
    <div class="fly-panel fly-panel-user" pad20 style="padding-top:20px;">
      <div class="fly-msg" style="margin-bottom: 20px;"> Hi，【<b th:text="${user.getUsername()}"></b>】，你已是我们的正式社员。 </div>
      <div class="layui-row layui-col-space20">
        <div class="layui-col-md6">
          <div class="fly-panel fly-panel-border">
            <div class="fly-panel-title"> 我的会员信息 </div>
            <div class="fly-panel-main layui-text" style="padding: 18px 15px; height: 50px; line-height: 26px;">
              <p> 您当前为：【 <b th:text="${vip}" style="color: red"></b> 】</p>
              <p> 您拥有博客飞吻：<span style="color: #FF7200; padding-right: 5px;">￥ <b th:text="${reward}"></b> 飞吻</span> <a href="user/charge"
                                                                                             target="_blank" class="layui-btn layui-btn-warm layui-btn-xs">充值</a> </p>
            </div>
          </div>
        </div>
        <div class="layui-col-md6">
          <div class="fly-panel-title">
            签到
            <i class="fly-mid"></i>
            <a href="javascript:;" class="fly-link" id="LAY_signinHelp1">签到说明</a>
            <i class="fly-mid"></i>
<!--            <a href="javascript:;" class="fly-link" id="LAY_signinTop1">活跃榜<span class="layui-badge-dot"></span></a>-->
            <span class="fly-signin-days">已连续签到<cite th:text="${days}"></cite>天</span>
          </div>
          <div class="fly-panel-main fly-signin-main">
            <button class="layui-btn layui-btn-danger" lay-submit lay-filter="LAY_signinuser">今日签到</button>
            <span>可获得<cite> 1 </cite>飞吻</span>

            <!-- 已签到状态 -->
            <!--
            <button class="layui-btn layui-btn-disabled">今日已签到</button>
            <span>获得了<cite>20</cite>飞吻</span>
            -->
          </div>
        </div>
        <div class="layui-col-md12" style="margin-top: -20px;">
          <div class="fly-panel fly-panel-border">
            <div class="fly-panel-title"> 快捷方式 </div>
            <div class="fly-panel-main">
              <ul class="layui-row layui-col-space10 fly-shortcut">
                <li class="layui-col-sm3 layui-col-xs4"> <a href="user/userInfo"><i class="layui-icon">&#xe620;</i><cite>修改信息</cite></a>
                </li>
                <li class="layui-col-sm3 layui-col-xs4"> <a href="user/userInfo"><i class="layui-icon">&#xe6af;</i><cite>修改头像</cite></a>
                </li>
                <li class="layui-col-sm3 layui-col-xs4"> <a href="user/userInfo/#pass"><i class="layui-icon">&#xe607;</i><cite>修改密码</cite></a>
                </li>
<!--               <li class="layui-col-sm3 layui-col-xs4" th:if="${user.getAvailable()==1}"> <a href="login/qq"><i class="layui-icon">&#xe770;</i><cite>解除绑定</cite></a>
                  </li>
                <li class="layui-col-sm3 layui-col-xs4" th:if="${user.getAvailable()==0}"> <a href="login/qq"><i class="layui-icon">&#xe770;</i><cite>帐号绑定</cite></a>
                </li>-->

<!--                <li class="layui-col-sm3 layui-col-xs4 LAY_search"> <a href="javascript:;"><i class="layui-icon">&#xe615;</i><cite>搜索资源</cite></a>
                </li>
                <li class="layui-col-sm3 layui-col-xs4"> <a href="/user/post/#collection"><i class="layui-icon">&#xe600;</i><cite>我的收藏</cite></a>
                </li>
                <li class="layui-col-sm3 layui-col-xs4"> <a href="http://www.layui.com/doc/"><i class="layui-icon">&#xe63c;</i><cite>文档</cite></a>
                </li>
                <li class="layui-col-sm3 layui-col-xs4"> <a href="http://www.layui.com/demo/"><i class="layui-icon">&#xe656;</i><cite>示例</cite></a>
                </li>-->
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<footer th:replace="footer::header-fragment"></footer>
<script th:replace="footer::script-fragment"></script>
<script src="res/layui/layui.js"></script>

<script>
layui.cache.page = 'user';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: 'res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "3.0.0"
  ,base: 'res/mods/'
}).extend({
  fly: 'index'
}).use(['fly', 'user','layer'], function(){
  var $ = layui.$
          ,setter = layui.setter
          ,admin = layui.admin
          ,form = layui.form
          ,router = layui.router()
          ,layer = layui.layer;

  //提交
  form.on('submit(LAY_signinuser)', function(obj){
    //获取表单参数
    var date = obj.field;
    var rememberMe = $("#rememberMe").is(':checked');
    //请求接口
    $.post('user/signin',{

    },function (res){
      if (res.success){
        layer.msg('签到成功！');
        setTimeout(function(){window.location.reload();},2000);
      }else {
        layer.msg(res.message);
        setTimeout(function(){window.location.reload();},2000);
      }
    },'json');

    return false;
  });
//签到说明
  $('#LAY_signinHelp1').on('click', function(){
    layer.open({
      type: 1
      ,title: '签到说明'
      ,area: '300px'
      ,shade: 0.8
      ,shadeClose: true
      ,content: ['<div class="layui-text" style="padding: 20px;">'
        ,'<blockquote class="layui-elem-quote">“签到”可获得社区飞吻，规则如下</blockquote>'
        ,'<table class="layui-table">'
        ,'<thead>'
        ,'<tr><th>连续签到天数</th><th>每天可获飞吻</th></tr>'
        ,'</thead>'
        ,'<tbody>'
        ,'<tr><td> < 7 </td><td> 每日获 1 </td></tr>'
        ,'<tr><td> = 7 </td><td> 当日获 5 </td></tr>'
        ,'<tr><td> = 14 </td><td> 当日获 10 </td></tr>'
        ,'<tr><td> = 21 </td><td> 当日获 15 </td></tr>'
        ,'<tr><td> > 28 </td><td> 每日获 3 </td></tr>'
        ,'</tbody>'
        ,'</table>'
        ,'<ul>'
        ,'<li>中间若有间隔，则连续天数重新计算</li>'
        ,'<li style="color: #FF5722;">不可利用程序自动签到，否则飞吻清零</li>'
        ,'</ul>'
        ,'</div>'].join('')
    });
  });
});
</script>

</body>
</html>